package com.itheima.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.itheima.common.R;
import com.itheima.dao.TbActivityDao;
import com.itheima.pojo.TbActivity;
import com.itheima.pojo.TbClue;
import com.itheima.service.TbActivityService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (TbActivity)表服务实现类
 *
 * @author makejava
 * @since 2022-01-16 15:48:53
 */
@Service("tbActivityService")
public class TbActivityServiceImpl implements TbActivityService {
    @Resource
    private TbActivityDao tbActivityDao;


    @Override
    public R getByChannel(String channel) {
        LambdaQueryWrapper<TbActivity> lqw=new LambdaQueryWrapper<>();
        lqw.eq(TbActivity::getChannel,channel);
        List<TbActivity> tbActivities = tbActivityDao.selectList(lqw);
        return new R(1,"返回活动列表",tbActivities);
    }

    @Override
    public R add(TbClue tbClue) {

        return new R(1,"线索添加成功!",null);
    }
}
